package com.xinyue.design.staticProxy;

/**
 * 秘书代理类
 * 该对象持有被代理的对象
 */
public class ClerkProxy implements Proxy{

	private Proxy proxy;
	
	public String info = "";
	
	/**
	 * 构造器
	 * 传入该代理类所要代理的对象
	 * @param proxy
	 */
	public ClerkProxy(Proxy proxy) {
		this.proxy = proxy;
	}
	
	public void work() {
		System.out.println("ClerkProxy begin!");
		if("agree".equals(info)) {
			proxy.work();
		}
		System.out.println("ClerkProxy end!");
	}

}
